//
//  WangqiTabBarController.m
//  SSC
//
//  Created by 红沙尘 on 2017/9/6.
//  Copyright © 2017年 红沙尘. All rights reserved.
//

#import "WangqiTabBarController.h"
#import "WangqiVC.h"

@interface WangqiTabBarController ()

@end

@implementation WangqiTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tabBar.hidden = YES;
    
    self.viewControllers = @[[[WangqiVC alloc] initWithType:CaipiaoTypeShishicai],
                             [[WangqiVC alloc] initWithType:CaipiaoTypeFenfencai]];
    
    
    self.navigationItem.titleView = [self myTitleView];
}

- (UIView *)myTitleView {
    
    UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 44)];
    
    UISegmentedControl *segment = [[UISegmentedControl alloc] initWithItems:@[@"重庆时时彩",@"两分彩"]];
    segment.frame = CGRectMake(0, 7, 200, 30);
    [titleView addSubview:segment];
    segment.tintColor = [UIColor whiteColor];
    segment.selectedSegmentIndex = 0;
    [segment addTarget:self action:@selector(segmentDidChanged:) forControlEvents:UIControlEventValueChanged];
    
    return titleView;
}

- (void)segmentDidChanged:(UISegmentedControl *)segment {
    self.selectedIndex = segment.selectedSegmentIndex;
}

- (void)back {
    [self.navigationController popViewControllerAnimated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
